﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<PersonalAlbumModel>" %>
<%@ Import Namespace="MyAlbum.Model" %>
<%@ Import Namespace="PersonalAlbum" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <%
        Entry item = ViewData.Model.CurrentEntry;
        if (item != null)
        {
            string tagConcated = Html.Encode(string.Join(",",item.Tags.Select(s => s.Name).ToArray()));
        
    %>
 
    <p id="backLink_entry"><%=Html.ActionLink(Model.Localize("Entry.Back"), "Index", "Entry", new { albumId = item.ParentId, page= 1 },null)%>
    <%--<%=Html.ActionLink<EntryController>(e=>e.Index(item.AlbumId,1),Model.Localize("Entry.Back")) %>--%>
    
    </p>
    <div id="entryContainer">
        
                    <h1>
                        <%=Html.Encode(item.Title)%>
                    </h1>
                          <br />
                    <span class="entryTime">
                        <%=item.Date.ToString("MMM d yyyy")%></span>
                  &nbsp;
                    <span class="entryTagsTitle"><%=Model.Localize("Entry.Tags")%>:</span>&nbsp; <span class="entryTags">
                        <%=tagConcated%></span>
                    <br />
                    <span>
                        <%=Html.Encode(item.Description)%></span>
                         <div>
                   <%=item.Render() %>
               </div> 
<%=Html.Tooltip(MyAlbum.Services.Configuration.ConfigValues.ShowSendToFriendBox)%>
               
                <%if (Model.Configuration.ShowSendToFriendBox)
                  { %>
                    <%Html.RenderPartial("SendToFriend");%>
                   <%} %>

<%=Html.Tooltip(MyAlbum.Services.Configuration.ConfigValues.ShowReplies)%>

                   
                     <%if (Model.Configuration.ShowReplies)
                       {%>
                   
               <%   Html.RenderPartial("ReplyItem");%>
                    
             <% } %>
<%=Html.Tooltip(MyAlbum.Services.Configuration.ConfigValues.AutoApproveReplies)%>
&nbsp;             
<%=Html.Tooltip(MyAlbum.Services.Configuration.ConfigValues.ShowAddRepliesBox)%>
             
            <%if (Model.Configuration.ShowAddRepliesBox)
              {
                  Html.RenderPartial("AddReply");
              } %>
                 
    </div>
   <%} %>
    <%if (Model.Configuration.UseCaptcha){ %>
 <script type="text/javascript">
    <!--
     function renderCaptcha() {
         var url = '<%=Url.Action("Render", "Captcha") %>';
         $.ajax({
             type: 'post',
             url: url,
             dataType: 'json',
             success: function(j) {
                 var src = '<%=Url.Action("Index", "Captcha") %>?r=' + Math.random();
                 var images = document.getElementsByName('captchaImages');
                 for (var i = 0; i < images.length; i++) {
                     images[i].src = src;
                 }
             }, error: function(XMLHttpRequest, textStatus, errorThrown) {

                 alert('<%=Model.Localize("Entry.Error") %>');
             }
         })
     }
    -->
 </script>
 <%} %>
</asp:Content>
